package com.dhl.fin.api.util;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.RandomUtil;
import com.dhl.fin.api.common.util.StringUtil;

import java.util.Set;

/**
 * @author CuiJianbo
 * @since 2025/4/27
 */
public class NumberGenerate {

    public static String generateBankCardNumber() {
        Set<Integer> set = RandomUtil.randomEleSet(CollUtil.newArrayList(4, 5, 5, 6, 6, 7, 8, 8, 8, 9), 5);
        String s1 = CollectionUtil.join(set, "");
        String s2 = RandomUtil.randomNumbers(5);
        return StringUtil.join(s1, "0000", s2);
    }

    public static String generateLendRecordNumber() {
        Set<Integer> set = RandomUtil.randomEleSet(CollUtil.newArrayList(4, 5, 5, 6, 6, 7, 8, 8, 8, 9), 5);
        String s1 = CollectionUtil.join(set, "");
        String s2 = RandomUtil.randomNumbers(10);
        return StringUtil.join(s1, s2);
    }
}
